<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.docman.domainmodel.*;" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<style type="text/css">
	table.changePassTable {font-size: 1.5em}
</style>
<script src="js/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="js/jquery.validate.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(function()
{	
	
	jQuery("#newPassword").validate(
            {
                expression: "if (VAL) return true; else return false;",
                message: " <span style=\"color:red\">Yeni sifreyi giriniz.</span>"
            });
	
	jQuery("#verifyNewPassword").validate(
            {
                expression: "if ( VAL && VAL === jQuery('#newPassword').val()) return true; else return false;",
                message: " <span style=\"color:red\">Sifreler uyuşmuyor!</span>"
            });
	
	jQuery("#currentPassword").validate(
	        {
	            expression: "if (VAL) return true; else return false;",
	            message: " <span style=\"color:red\">Eski şifrenizi giriniz.</span>"
	        });
	
	
	
});

</script>

</head>
<body>

<div id="main_container">
	<div id="header">
			<div class="logo"><a href="index.jsp"><img src="img/top.png" border="0" alt="" title="" /></a></div>       
	</div>
        <div class="menu">
        	<ul>                                                                         
        		<li><a href="index.jsp">Anasayfa</a></li>
                <li class="selected"><a href="profileServletpath">Profil</a></li>
                <li><a href="getTagServletpath?sId=0">Dosya Yükleme</a></li>
                <li><a href="getTagServletpath?sId=1">Ayrıntılı arama</a></li>
                <li><a href="contract.jsp">İletişim</a></li>
                <% if(session.getAttribute("currentSessionUser")!= null){ 
                 UserBean user = (UserBean)session.getAttribute("currentSessionUser");%>
                <li><a href="logout.jsp">Çıkış <span style="color: red;">(<span style="font-weight: bold;
                     text-decoration: underline"><%= user.getUserName() %></span>)</span></a></li>
                     <% } else { %>
                <li><a href="getUniandDeptServletpath">Kaydol</a></li>
                <% } %>
        	</ul>
        </div>
        
    <div class="center_content">
    
        <% if(session.getAttribute("currentSessionUser")!= null){ 
        UserBean user = (UserBean)(session.getAttribute("currentSessionUser"));
        String errorMsg = (String)request.getAttribute("error"); %>
        <% if(errorMsg != null){ %>
        <ul>
        	<li><h3 style="color: red"><%= errorMsg %></h3></li>
        </ul>
         <% } %>
        
        	<form action="changePasswordServletpath" method="post">
        	<center>
        		<table class="changePassTable" cellspacing="1.2em" cellpadding="1.2em">
        			<tr>
        				<td>Şimdiki Şifre:</td>
        				<td><input type="password" name="currentPassword" size="30" id="currentPassword"/></td>
        			</tr>
        			<tr>
        				<td>Yeni Şifre:</td>
        				<td><input type="password" name="newPassword" size="30" id="newPassword"/></td>
        			</tr>
        			<tr>
        				<td>Yeni Şifre Tekrarı:</td>
        				<td><input type="password" name="verifyNewPassword" size="30" id="verifyNewPassword"/></td>
        			</tr>
        			<tr>
        				<td colspan="2"><center><input type="submit" name="submit" class="button" value="Değiştir"/></center></td>
        			</tr>
        		</table>
        		</center>
        		<input type="hidden" name="userName" value="<%= user.getUserName() %>"/>
        		           
			</form>
		<% }else { %>
		
			<p style="font-size: 1.5em; text-align: center;color:red">Lütfen <a href="index.jsp">Anasayfa</a>'dan giriş yapınız.  </p>	
			<p style="font-size: 1.5em; text-align: center;color:red">Veya menüden Kaydol butonuna tıklayıp sitemize üye olabilirsiniz. </p>
		
		<% } %> 
    </div>
         
</div>

</body>
</html>